package org.labo.sigmalivepaper;

import java.util.List;

import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceActivity;

public class MyPreferenceActivity extends PreferenceActivity {

	@Override
	  protected void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    
	    addPreferencesFromResource(R.xml.prefs);

	    // We want to add a validator to the number of circles so that it only
	    // accepts numbers
	    Preference touchPreference = getPreferenceScreen().findPreference("touch");
	    touchPreference.setOnPreferenceChangeListener(touchListener);
	    
	    Preference shakePreference = getPreferenceScreen().findPreference("shake");
	    shakePreference.setOnPreferenceChangeListener(shakeListener);

	    // Add the validator
	    //touchPreference.setOnPreferenceChangeListener(numberCheckListener);
	  }
	
	/*@Override
    public void onBuildHeaders(List<Header> target) {
        loadHeadersFromResource(R.xml.prefs, target);
    }*/
	
	OnPreferenceChangeListener touchListener = new OnPreferenceChangeListener() {
		@Override
		public boolean onPreferenceChange(Preference preference, Object newValue) {
		  	return true;
		}
	};
	
	OnPreferenceChangeListener shakeListener = new OnPreferenceChangeListener() {
		@Override
		public boolean onPreferenceChange(Preference preference, Object newValue) {
		  	return true;
		}
	};
	
}
